/**
 * ==================================================================================
 * Copyright (c) 2012 All Rights Reserved.
 * 
 * Author: 	Jye Cusch
 * Owner:	Team LAAC
 * Date:	04/11/2012
 * 
 * Summary:	Data storage class, to hold information about a single book.
 * 
 * ==================================================================================
 */

package au.com.somethingwritten.model;

public class Book {
	private int id;
	private String isbn;
	private String title;
	private String author;
	private String category;
	private Double price;
	private Integer year;
	private String edition;
	private Double discount;
	private Integer quantity;
	private String imagePath;
	private String description;
	
	public Book(int id, String isbn, String title, String author, 
			String category, Double price, 
			int year, String edition, double discount,
			int quantity, String imageFile, String description){
		this.id = id;
		this.isbn = isbn;
		this.title = title;
		this.author = author;
		this.category = category;
		this.price = price;
		this.year = year;
		this.edition = edition;
		this.discount = discount;
		this.quantity = quantity;
		this.imagePath = imageFile;
		this.description = description;
	}
	
	//New toString method
	public String toString(){
		return isbn + ", " +
				title + ", " +
				author + ", " +
				category + ", $" +
				price.toString() + ", " +
				year.toString() + ", " +
				edition + ", " +
				description;
		
	}
	
	public void sellCopies(int numSold){
		this.quantity -= numSold;
	}
	
	public Integer getId(){
		return this.id;
	}
	public String getISBN(){
		return this.isbn;
	}
	public String getTitle(){
		return this.title;
	}
	public String getAuthor(){
		return this.author;
	}
	public String getCategory(){
		return this.category;
	}
	public Double getPrice(){
		return this.price;
	}
	public int getYear(){
		return this.year;
	}
	public String getEdition(){
		return this.edition;
	}
	public double getDiscount(){
		return this.discount;
	}
	public Integer getQuantity(){
		return this.quantity;
	}
	public void setQuantity(int newQuantity){
		this.quantity = newQuantity;
	}
	public String getImageFile(){
		return this.imagePath;
	}
	public String getDescription(){
		return this.description;
	}
}



